import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import mgop from '@/utils/mgop.js';
import { zlbApis } from '@/utils/zlbApi.js';
import { confusePhone, confuseIdCard, confuseName, confuseOther, value2text, getType } from '@/utils/common.js';
import { Notify, ImagePreview, Toast, Dialog } from '@/utils/customVant.js';
import { formAutoVerify, formatDataTree, noRecurForTree,arrFlatData } from '@/utils/formInstr.js';
import './plugin/vant';
import '@/styles/reset.scss';
import '@/styles/index.scss';
import '@/styles/customVant.scss';
Vue.use(Notify);
Vue.use(Toast);
Vue.config.productionTip = false;

// 注册全局接口调用api
Vue.prototype.$get = mgop.get;
Vue.prototype.$post = mgop.post;
Vue.prototype.$delete = mgop.delete;
Vue.prototype.$put = mgop.put;

// 注册全局工具函数
Vue.prototype.$notify = Notify;
Vue.prototype.$ImagePreview = ImagePreview;
Vue.prototype.$toast = Toast;
Vue.prototype.$Dialog = Dialog;
Vue.prototype.$value2text = value2text;
Vue.prototype.$getType = getType;
Vue.prototype.$formAutoVerify = formAutoVerify;
Vue.prototype.$formatDataTree = formatDataTree;
Vue.prototype.$noRecurForTree = noRecurForTree;
Vue.prototype.$arrFlatData = arrFlatData;

// 注册全局浙里办API
Vue.prototype.$zlbApis = zlbApis;

// 注册全局脱敏函数
Vue.prototype.$confusePhone = confusePhone;
Vue.prototype.$confuseIdCard = confuseIdCard;
Vue.prototype.$confuseName = confuseName;
Vue.prototype.$confuseOther = confuseOther;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');
